<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="include/taglib.jsp" %>
<!DOCTYPE html>
<html>
<head>
    <c:set var="projectName" value='${fnc:getDBConfig("sys","common","project.name")}' />
    <c:set var="projectCopyright" value='${fnc:getDBConfig("sys","common","project.copyright")}' />
    <title>${projectName.configValue} - 用户登录</title>
    <%@ include file="include/head.jsp" %>
    <style>
        .header {
            text-align: center;
        }
        .header h1 {
            font-size: 200%;
            color: #333;
            margin-top: 30px;
        }
        .header p {
            font-size: 14px;
        }
    </style>
</head>
<body>
<div class="header">
    <div class="am-g">
        <h1>${projectName.configValue}</h1>
        <p>一套SpringMVC+Mybatis基础核心框架</p>
    </div>
    <hr />
</div>
<div class="am-g">
    <div class="am-u-lg-6 am-u-md-8 am-u-sm-centered">
        <h3>用户登录</h3>
        <hr>
        <form class="am-form">
            <label for="username">账号:</label>
            <input type="text" name="username" id="username" required>
            <br>
            <label for="password">密码:</label>
            <input type="password" name="password" id="password" required>
            <br>
            <label for="remember-me">
                <input id="remember-me" name="rememberMe" type="checkbox">
                记住登录
            </label>
            <br />
            <div class="am-cf">
                <input type="button" id="login" value="登 录" class="am-btn am-btn-primary am-btn-sm am-fl">
                <input type="button" value="忘记密码？" onclick="iuAlert('请联系管理员获取密码！')" class="am-btn am-btn-default am-btn-sm am-fr">
            </div>
        </form>
        <hr>
        <p>${projectCopyright.configValue}</p>
    </div>
</div>
<%@ include file="include/bottom.jsp" %>
<script type="text/javascript">
    $(document).ready(function () {
        $("#login").click(function () {
            var username = $("#username").val();
            if(username==""){
                iuMsg("用户名不能为空");
                return;
            }
            var password = $("#password").val();
            if(password==""){
                iuMsg("密码不能为空");
                return;
            }
            post("${ctx}/login",{username:username,password:password},function(data){
                console.log(data);
            });
        });
    });
    var rest = '${rest}';
</script>
</body>
</html>